<?php include 'breadcrumb.html';
    $this->doctype('XHTML1_STRICT');
    $home_admin=$this->baseUrl()."/".$this->config('adminpath');
        function session(){
            return $_SESSION['Inweb_Admin_Auth']['auth'];
        }
        $session=session();
     $this->edit_profile= $this->inwebUrl(array('action'=>'edit','id'=>$session->id,'controller'=>'user','module'=>'admin'),'admin');
     $this->data_account=$this->inwebUrl(array('controller'=>'profile'),'admin');
?>
<?php echo $this->docType(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<?php echo $this->config('themeadminurl'); ?>/" />
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title><?php echo 'Admin :: '.$this->config('sitename');?></title>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-tagsinput.css" rel="stylesheet">
    <link href="css/admin_inweb.css" rel="stylesheet">
    <link href="font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="css/datepicker3.css" rel="stylesheet" type="text/css">
    <link href="css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css">
    <script src="js/jquery-1.11.0.js"></script>
<script language="javascript" type="text/javascript">
	var menulink="<?php echo $this->inwebUrl(array('action'=>'menu','controller'=>'index','module'=>'admin','user'=>$this->config('mUser')),null,true)?>";
	var deletelink="<?php echo $this->inwebUrl(array('action'=>'delete','user'=>$this->config('mUser')))?>";
	var indexlink="<?php echo $this->inwebUrl(array('action'=>'index','user'=>$this->config('mUser')))?>";
	var searchlink="<?php echo $this->inwebUrl(array('action'=>'search','user'=>$this->config('mUser')))?>";
	var orderlink="<?php echo $this->inwebUrl(array('action'=>'order','user'=>$this->config('mUser')))?>";
	var baseurl="<?php echo $this->baseUrl() ?>";
	var _editor_url  = "<?php echo $this->baseUrl('assets/js/Xinha-0.96.1') ?>";
	var _editor_lang = "en";
</script>
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top inweb-navbar" role="navigation" style="margin-bottom: 0">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php echo $home_admin?>">
                <?php echo $this->logoHeader(array('text-wrapper'=>'span')) ?>
        </a>
    </div>
<!-- /.navbar-header --> 
    <ul class="nav navbar-top-links navbar-left">
        <li>
            <a href="<?php echo $this->config()->baseurl ?>" target="_blank" class="btn btn-inweb btn-outline">VIEW THE WEBSITE</a>
        </li>
    </ul>
        <ul class="nav navbar-top-links navbar-right">
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <img src="images/user.png" width="31" />
                    <?php echo $session->name;?>
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="#">Anda Login Sebagai : <?php echo $session->username;?> </a></li>
                    <li> <a href="<?php echo $this->data_account; ?>">Data Account</a></li>
                    <li class="divider"></li>
                    <li id="logout"></li>
                </ul>
            </li>
    <!-- /.dropdown -->
        </ul>

            <!-- /.navbar-top-links -->
    <div class="navbar-default sidebar" role="navigation">
        <div class="sidebar-nav navbar-collapse">
            <ul class="nav" id="side-menu">
                <li>
                    <a href="<?php echo $home_admin?>">
                        <img src="images/home.png" />
                        Overview
                    </a>
                </li>
                <li class="alt_menutop">
                    <a href="<?php echo $this->baseUrl();?>" />
                        <img src="images/globe.png" /> 
                        View Website
                    </a>
                </li>
                <li class="alt_menutop">
                    <a href="#">
                        <img src="images/user2.png" /> 
                        <?php echo $session->name;?>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="nav nav-second-level">
                        <li>
                            <a href="#">
                                Anda Login Sebagai : <?php echo $session->username;?>
                            </a>
                        </li>
                        <li> 
                            <a href="<?php echo $this->data_account; ?>">
                                Data Account
                            </a>
                        </li>
                        <li id="logout"></li>
                    </ul>
                    <!-- /.nav-second-level -->
                </li>
            </ul>
        </div>
        <!-- /.sidebar-collapse -->
    </div>
<!-- /.navbar-static-side -->
</nav>

<div id="page-wrapper">
<?php if($this->layout()->content){ ?>
    <div class="row">
        <!-- Breadcrumbs -->
        <?php //if($ses_menuActive && $ses_menuActive2==$this->moduletitle):?>
        <!-- <div class="col-lg-12">
            <ol class="breadcrumb">
              <li class="active"><?php //echo $ses_menuActive;?></li>
              <li class="active"><?php //echo $ses_menuActive2;?></li>
            </ol>
        </div> -->
        <?php //endif;?>
        <!-- END Breadcrumbs -->
         <?php if($this->moduletitle):?>
        <div class="col-lg-12">
            <h1 class="h1"><?php echo $this->moduletitle;?></h1><hr class="hr">
        </div>
        <?php endif;?>
    <?php if(count($this->submenu)>0){?>
        <div class="col-lg-12">
            <form method="post" action="" id="searchForm">
                <div class="form-inline">
                    <div class="form-group">
                        <div class="btn-group">
                    <?php 
                        foreach($this->submenu as $sm ):
                         if($sm['title']=='Browse'){
                                $sm['title']='Refresh';
                            }
                        if($sm['li-class']=='admin-delete'){
                            $icon='<i class="fa fa-times fa-lg"></i>';
                        }elseif($sm['li-class']=='admin-add'){
                            $icon='<i class="fa fa-plus fa-lg"></i>';
                        }elseif ($sm['li-class']=='admin-browse') {
                            $icon='<i class="fa fa-th-list fa-lg"></i>';
                        }else{
                            $icon='<strong>'.$sm['title'].'</strong>';
                        }?>
                            <a href="<?php echo $sm['url'] ?>" title="<?php echo $sm['title'] ?>" class="btn btn-default">
                                <?php echo $icon ?>
                            </a>
                        <?php endforeach;?>
                        </div>
                    </div>
                    
                    <?php 
                            if(isset($this->form_fields)){
                                    echo $this->admin()->searchForm($this->form_fields);
                            }
                    ?>
                </div>
            </form>
        </div>
<?php };?>
        <div class="col-lg-12 top10">

            <div class="tempat-table">
                        <?php echo $this->layout()->content ?>
                    </div>
        </div>
            <?php } 
                    else{
                            echo $this->partial('home.html');
                        }
            ?>
        </div>
        <!-- /#page-wrapper -->

</div>
    <!-- /#wrapper -->
    <script type="text/javascript">

    //$.noConflict();

    </script>
    <script src="js/admin.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-tagsinput.min.js"></script>
    <script src="js/plugins/metisMenu/metisMenu.min.js"></script>
    <script src="js/admin_inweb.js"></script>
    <script src="<?php echo $this->baseUrl('assets/js/Xinha-0.96.1/XinhaCore.js?skin=silva');?>"></script>
    <script src="js/bootstrap-datepicker.js"></script>
    <script src="js/locales/bootstrap-datepicker.id.js"></script>
    <script src="js/moment.min.js"></script>
    <script src="js/bootstrap-datetimepicker.min.js"></script>
    
        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<script language="javascript" type="text/javascript">
    //$.noConflict();
    /** xinha **/
    var xinha_plugins =
    [
     'ImageManager'
    ];
    
    function xinha_init(){
      if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
        
        var xinha_editors=[];
      $('textarea.richeditor').each(function(){
        xinha_editors[xinha_editors.length]=$(this).attr('name');
      });
      
      var xinha_config = new Xinha.Config();
        xinha_config.height='auto';
        xinha_config.width='auto';
      xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
        
      Xinha.startEditors(xinha_editors);
    }
    $(document).ready(function(){    
        xinha_init();   
        
    });
</script>
	</body>
</html>
